package pl.myapp.webtest.interceptor;

import pl.myapp.webtest.interceptor.annotation.CakeProposition;

import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;

/**
 * Created by IntelliJ IDEA.
 * User: kaafaar
 * Date: 14.05.11
 * Time: 23:41
 * To change this template use File | Settings | File Templates.
 */
@CakeProposition
@Interceptor
public class LetsEatCake {

    public LetsEatCake() {
    }

    @AroundInvoke
    public Object question(InvocationContext invocationContext) throws Exception {
        System.out.println("add cake for coffee ?? "+
                            "Entering method: " + invocationContext.getMethod().getName()
                            + " in class "
                            + invocationContext.getMethod().getDeclaringClass().getName()
        );

        return invocationContext.proceed();
    }
}
